package util;

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Scanner;

/**
 * Created by Administrator on 2023/11/23.
 */
public class URLCrawler {
    public static void main(String[] args) throws Exception {
        URL url = new URL(
                "https://news.qq.com");
        InputStream input = url.openStream();
        Scanner cin = new Scanner(new BufferedInputStream(input));
        while (cin.hasNextLine()) {
            System.out.println(cin.nextLine());
        }
        input.close();
        cin.close();
    }
}
